//
//  Api.h
//  KangarooDoctor
//
//  Created by 廖罡 on 2024/1/12.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^ApiCallback)(id _Nullable result, NSString * _Nullable err);

@interface Api : NSObject

+(instancetype)shared;

@property (nonatomic, strong) NSString *host;
@property (nonatomic, strong) NSNumber *port;

-(void)macClientTest;

-(void)postAtPath:(NSString*)path callback:(ApiCallback)callback;
-(void)postAtPath:(NSString*)path param:(NSDictionary*)param callback:(ApiCallback)callback;
-(void)postAtPath:(NSString*)path param:(NSDictionary*)param header:(NSDictionary<NSString*, NSString*>*)header callback:(ApiCallback)callback;


-(void)putAtPath:(NSString*)path callback:(ApiCallback)callback;
-(void)putAtPath:(NSString*)path param:(NSDictionary*)param callback:(ApiCallback)callback;
-(void)putAtPath:(NSString*)path param:(NSDictionary*)param header:(NSDictionary<NSString*, NSString*>*)header callback:(ApiCallback)callback;


-(void)getAtPath:(NSString*)path callback:(ApiCallback)callback;
-(void)getAtPath:(NSString*)path param:(NSDictionary*)param callback:(ApiCallback)callback;
-(void)getAtPath:(NSString*)path param:(NSDictionary*)param header:(NSDictionary<NSString*, NSString*>*)header callback:(ApiCallback)callback;


-(void)deleteAtPath:(NSString*)path callback:(ApiCallback)callback;
-(void)deleteAtPath:(NSString*)path param:(NSDictionary*)param callback:(ApiCallback)callback;
-(void)deleteAtPath:(NSString*)path param:(NSDictionary*)param header:(NSDictionary<NSString*, NSString*>*)header callback:(ApiCallback)callback;


-(void)method:(NSString*)method
       path:(NSString*)path
        param:(NSDictionary*)param
       header:(NSDictionary<NSString*, NSString*>*)header
     callback:(ApiCallback)callback;

@end




NS_ASSUME_NONNULL_END
